#!/usr/bin/env python

import sys
import os
import re

BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
command = sys.argv[1]

hosts = ['berweb01', 'tuvweb02', 'devweb01', ]

if command == 'changed':
    print "U   config/typ/web/data/is24/www/index.html"
elif command == 'tree':
    revision = sys.argv[7]
    path = os.path.join(BASE_DIR, 'testdata/revs', revision, 'hosts.txt')
    f = open(path)
    try:
        for host in f:
            if re.match('\w+', host):
                print 'config/host/%s/' % host
    finally:
        f.close()
